package ruifeng.zcj.happymahjony.activity.base;

import android.annotation.SuppressLint;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Toast;

import org.apache.cordova.CordovaActivity;

import ruifeng.zcj.happymahjony.manager.ActivityManager;

/**
 * Cordova基层窗口<br/>
 */
public class BaseCordovaActivity extends CordovaActivity {

    /**
     * 全屏<br/>
     */
        public void setFullScreen() {
        setBooleanProperty("showTitle", false);
        setBooleanProperty("setFullscreen", true);
    }

    /**
     * 设置等待图<br/>
     */
    public void setSplashScreen(int resId) {
        setIntegerProperty("splashscreen", resId);
    }

    /**
     * 设置网络超时<br/>
     */
    public void setUrlTimeout(int time) {
        setIntegerProperty("loadUrlTimeoutValue", time);
    }

    /**
     * Toast提示<br/>
     */
    public void showToast(String text) {
       // Toast.makeText(this, text, Toast.LENGTH_SHORT).show();
    }

    /**
     * Toast提示<br/>
     */
    public void showLongToast(String text) {
        Toast.makeText(this, text, Toast.LENGTH_LONG).show();
    }

    public void finish() {
        super.finish();
        ActivityManager.getInstance().removeActivity(this);
    }
}
